import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class CreateUserDto {
  @ApiProperty({ description: '用户名' })
  @IsNotEmpty({ message: '名称不能为空' })
  @IsString({ message: '名称类型为字符串' })
  readonly username: string;

  @ApiProperty({ description: '简称' })
  @IsNotEmpty({ message: '简称不能为空' })
  @IsString({ message: '简称类型为字符串' })
  readonly nickname: string;

  @ApiProperty({ description: '密码' })
  @IsNotEmpty({ message: '密码不能为空' })
  readonly password: string;

  @ApiPropertyOptional({ description: '用户头像' })
  readonly avatar: string;

  @ApiProperty({ description: '邮箱' })
  @IsNotEmpty({ message: '邮箱不能为空' })
  @IsString({ message: '邮箱类型为字符串' })
  readonly email: string;
}
